 |

|
Getting Started
Welcome to the Internet Control Pack. The present package includes a set of eight ActiveX™ Controls (formerly called OLE controls) that can be used with 32-bit versions of
Microsoft Access, Visual Basic, Visual C++ and Visual FoxPro. With these controls, you can create applications that work over any network supporting one of the following protocols: TCP/IP, FTP, HTTP, SMTP, and POP3.
Until the Internet Control Pack, creating applications that would access the rich information sources of the Internet required learning about various low level Winsock Application Programming Interfaces (APIs) as well as the various protocols. The Internet Control Pack hides the complexity of creating Internet programs while exposing the versatility and power of ActiveX™ Controls.
|
|
|
ActiveX Controls Summary
|
|
WinSock TCP ActiveX Control
Used to stream data between networked machines. This is a connection-based control, meaning the communicating machines have an explicit connection.
|
|
WinSock UDP ActiveX Control
Used to stream data between machines, but without requiring an explicit connection.
|
|
FTP Client ActiveX Control
Allows you to connect to a remote machine, examine its directories, send and retrieve data using the File Transport Protocol.
|
|
HTTP ActiveX Control
The HyperText Transfer Protocol is the protocol used for World Wide Web sites. This control allows you to gather data which can be parsed, filtered, or placed in a database.
|
|
HTML ActiveX Control
The HyperText Markup Language is used to create World Wide Web documents. This control translates the language into viewable pages, allowing you to create your own custom Web browser. The control currently supports HTML version 2.0.
|
|
POP ActiveX Control
The Post Office Protocol (version 3) is the most commonly used protocol for email on the Internet. With this control you can create a virtual post office to store email messages.
|
|
SMTP ActiveX Control
The Simple Mail Transport Protocol is used to send email messages on the Internet. With this control you can send email messages from any application.
|
|
NNTP ActiveX Control
The NNTP Client control is used to connect to a news server, retrieve a list of available newsgroups and their descriptions, enter a newsgroup, retrieve lists of articles or particular articles.
|
|
|
Internet Requirements
|
To use these controls on the Internet, you also need the following:
- An Internet provider--a local commercial service that provides you access to the Internet.
- A modem or ISDN line--a physical connection between you and your Internet provider.
- Either a PPP (Point to Point Protocol) or a SLIP (Serial Line Internet Protocol)--provided by your Internet service. This allows you to fully access the graphic capabilities of the Internet.
The Internet Control Pack was designed with productivity and ease of use in mind. To this end, all you need--besides the controls--is to connect to your Internet provider, start up your application (Visual Basic, Visual C++, Visual FoxPro, or Microsoft Access), and begin programming.
|
|
|
Network Requirements
|
If you are using the controls on a local area network, you need to know which protocols are supported on the network. For example, most networks support the TCP/IP protocol, and this allows you to use the WinSock UDP or TCP controls. The following table shows the protocols supported by the controls.
Control |
Protocol Supported |
FTP |
File Transport Protocol (FTP) |
HTML |
HTTP |
HTTP |
HyperText Transfer Protocol (HTTP) |
NNTP |
Network News Transport Protocol (NNTP) |
POP |
Post Office Protocol, version 3 (POP3) |
SMTP |
Simple Mail Transport Protocol (SMTP) |
WinSock TCP |
TCP/IP |
WinSock UDP |
TCP/IP |
|
|
|
Installing the Controls
|
Methods to install the controls into the toolbox differ according to the application you are using.
In Visual Basic:
- Click the Tools menu, then click Custom Controls.
- Under Available Controls, select the control you want to use.
- Click OK.
In Visual FoxPro:
- Click the Tools menu, then click Options.
- Click the Controls tab, then click the OLE controls option. Be sure the Controls check box is selected.
- Under Selected, select the controls you wish to install.
- Click Set as Default if you'd like to make these controls available in every Visual FoxPro session.
- Click OK.
For Microsoft Access:
While in form Design view:
- Click the Insert menu, then click Custom Control... .
- Select the custom control you want to insert.
- Click OK.
If the custom control does not appear in the custom control dialog, it may not be correctly registered on your machine.
To register a custom control:
- Click the Tools menu, then click Custom Controls... .
- Click the Register button and locate the custom control .OCX or .DLL file to register.
- Click OK.
In Visual C++:
Note: OLE controls are added to individual Visual C++ projects. To use an OLE control in multiple projects, you must add it to each project in which you want to use it.
- From the Insert menu, choose Component, or click the Component Gallery button. The Component Gallery dialog box appears.
- In Component Gallery, select the OLE Controls pane (page, tab).
- Select the control and click the Insert button. The Confirm Classes dialog box appears. This dialog lists the names for the C++ class, header file, and implementation file for each control begin added.
- In the Confirm Classes dialog box, click OK. The control is added to the control pallet in the dialog template editor, and header and implementation files are added to the current project for this control.
|
|
|
Common Terminology
|
The following is a short list of terms that occur in the documentation:
Client: An application designed to connect to a remote machine and access data on the other machine. Part of a Client/Server relationship.
Data Streaming: The transfer of data in a continuous stream of bytes, allowing transactions such as real-time sound transmission. Data streaming also allows you to efficiently pour data into a file, database, or other container.
MIME: The Multipurpose Internet Mail Protocol communicates the type of data that is being sent in an electronic message. For example, a message can contain sound, video, images, as well as text.
Port Number: Internet applications use a specific port number to communicate through. There are common port numbers assigned to types of applications. For example, HTTP servers (used for retrieving HTML documents) usually send and receive data through port 80.
Protocol: A defined convention used to communicate between applications. For example, the HTTP protocol specifies how HTTP messages should be sent and recieved.
RFC: A Request For Comments document (as in "RFC 977") is authored by an individual or group involved in the development of the Internet. Such documents define standards or propose new standards for Internet protocols. These documents are available for downloading from various sites. See the Internet References topic for specific FTP addresses.
Server: An application that provides services and data for a Client application that resides on a remote machine.
|
|
|
Control Architecture
|
The Internet Control Pack is designed as a family of controls with a few common interfaces that allow you to develop applications quickly. Famliarizing yourself with these common interfaces can save you time later.
DocInput and DocOutput Objects
An innovative feature of the Internet Control Pack are the and the DocOutput object. These objects, accessible from all controls except the WinSock controls, have properties and methods that allow you to stream data from one control to another. For example, using the DocOutput object, you can automatically stream data from a HTTP server to an FTP control when you wish to archive the data on an FTP server. For more information see Using the DocInput and DocOutput Objects.
icError Object and Collection
Another common object is the cError object and icErrors collection. The icError object stores error messages that originate from a network server. As errors may be numerous, the icError object can be stored in a collection for later retrieval.
|
|
|
DocHeader Object and Collection
|
Some protocols, such as the MIME and the SMTP, require you to create a collection of document headers.
For example, when sending a mail message, you will see these headers:
From: Jonne@Maui.com
To: TomS@Haleakala.com
Subject: Run to the Sun
Message-Id: 9601138242.AA824256464@mail.Maui.com
Each line in the above example would be contained in a single DocHeader object, and all four lines would be part of a DocHeaders collection.
A DocHeader object has two properties: the Name property, and the Value property. The following code shows how you can create a simple header by first creating an object variable of type DocHeaders, instantiating the object, and then adding a DocHeader object to the collection.
Dim dhHeads As DocHeaders ' Object variable.
Set dhHeads = New DocHeaders ' Instantiate object.
dhHeads.Add "From", "Jonne@Maui.com " ' Add Header.
' Creates the header "From: Jonne@Maui.com"
' The DocHeader object adds the colon for you.
|
|